package com.iraeta.service.worklog.impl;

import com.iraeta.dao.worklog.WorkLogDao;
import com.iraeta.entity.WorkLog;
import com.iraeta.service.worklog.WorkLogService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class WorkLogServiceImpl implements WorkLogService {
    @Resource
    WorkLogDao workLogDao;

    @Override
    public WorkLog getWorkLog(int id) {
        return workLogDao.getWorkLogById(id);
    }

    @Override
    public List<WorkLog> getWorkLogByCondition(Integer userId, String startDate, String endDate) {
        return workLogDao.selectByCondition(userId, startDate, endDate);
    }

    @Override
    public int addWorkLog(WorkLog workLog) {
        return workLogDao.insertWorkLog(workLog);
    }

    @Override
    public int updateWorkLog(WorkLog workLog) {
        return workLogDao.updateWorkLog(workLog);
    }

    @Override
    public int deleteWorkLog(int id) {
        return workLogDao.deleteWorkLog(id);
    }
}
